<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>LetvPlayer播放器API说明 | 简介</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.4">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../part1/playcontext_introduction.html" />
    
    
    <link rel="prev" href="../part1/player_structure.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="2.2"
        data-chapter-title="LetvPlayer播放器API说明"
        data-filepath="part1/player_api_introductions.md"
        data-basepath=".."
        data-revision="Mon Jan 25 2016 11:35:25 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        简介
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="part0/index.html">
            
                
                    <a href="../part0/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        快速开始
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="part0/import_project.html">
            
                
                    <a href="../part0/import_project.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        集成工程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="part0/get_start_play.html">
            
                
                    <a href="../part0/get_start_play.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        启动播放器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="part0/handle_video_ratio.html">
            
                
                    <a href="../part0/handle_video_ratio.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        处理视频比例
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="part0/handle_video_view_change.html">
            
                
                    <a href="../part0/handle_video_view_change.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        处理屏幕旋转
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="part0/hanlde_proguard.html">
            
                
                    <a href="../part0/hanlde_proguard.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        关于混淆
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="part1/index.html">
            
                
                    <a href="../part1/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        第一章
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="part1/player_structure.html">
            
                
                    <a href="../part1/player_structure.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        播放器基本架构
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.2" data-path="part1/player_api_introductions.html">
            
                
                    <a href="../part1/player_api_introductions.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        LetvPlayer播放器API说明
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="part1/playcontext_introduction.html">
            
                
                    <a href="../part1/playcontext_introduction.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        PlayContext ApI说明
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="download/download_module.html">
            
                
                    <a href="../download/download_module.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        下载模块
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="download/download_letter.html">
            
                
                    <a href="../download/download_letter.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        快速接入
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="download/download_center.html">
            
                
                    <a href="../download/download_center.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        DownloadCenter API说明文档
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="download/download_observer.html">
            
                
                    <a href="../download/download_observer.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        LeDownloadObserver API说明文档
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="download/download_info.html">
            
                
                    <a href="../download/download_info.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        LeDownloadInfo API 说明文档
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="update.html">
            
                
                    <a href="../update.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        更新说明
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >简介</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="letvplayer&#x64AD;&#x653E;&#x5668;api&#x8BF4;&#x660E;">LetvPlayer&#x64AD;&#x653E;&#x5668;API&#x8BF4;&#x660E;</h1>
<p>&#x5728;&#x4E00;&#x4E2A;&#x89C6;&#x9891;&#x64AD;&#x653E;&#x7684;&#x8FC7;&#x7A0B;&#x4E2D;&#xFF0C;&#x64AD;&#x653E;&#x5668;&#x9700;&#x8981;&#x7ECF;&#x5386;<code>&#x521B;&#x5EFA;</code>&#x3001;<code>&#x64AD;&#x653E;</code>&#x3001;&#x6700;&#x540E;<code>&#x91CA;&#x653E;</code>&#x7684;&#x8FC7;&#x7A0B;&#x3002;&#x64AD;&#x653E;&#x8FC7;&#x7A0B;&#x671F;&#x95F4;&#xFF0C;&#x64AD;&#x653E;&#x5668;&#x4F1A;&#x4E3B;&#x52A8;&#x7684;&#x544A;&#x8BC9;&#x6211;&#x4EEC;&#x4E00;&#x4E9B;<code>&#x56DE;&#x8C03;&#x4E8B;&#x4EF6;</code>,&#x6216;&#x8005;&#x8BF4;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x4E3B;&#x52A8;&#x7684;&#x83B7;&#x53D6;&#x4E00;&#x4E9B;<code>&#x64AD;&#x653E;&#x5668;&#x53C2;&#x6570;</code>&#xFF0C;&#x8FD9;&#x65F6;&#x5019;&#x5C31;&#x9700;&#x8981;&#x5145;&#x5206;&#x5229;&#x7528;&#x597D;LePlayer&#x6240;&#x63D0;&#x4F9B;&#x7684;&#x65B9;&#x6CD5;&#x4E86;&#xFF01;</p>
<h2 id="&#x521D;&#x59CB;&#x5316;&#x548C;&#x51C6;&#x5907;">&#x521D;&#x59CB;&#x5316;&#x548C;&#x51C6;&#x5907;</h2>
<table>
<thead>
<tr>
<th>&#x65B9;&#x6CD5;&#x540D;&#x5B57;</th>
<th>&#x7B80;&#x8981;&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>init</td>
<td>&#x64AD;&#x653E;&#x5668;&#x521D;&#x59CB;&#x5316;</td>
</tr>
<tr>
<td>setParameter</td>
<td>&#x8BBE;&#x7F6E;&#x64AD;&#x653E;&#x5668;&#x53C2;&#x6570;</td>
</tr>
<tr>
<td>setDataSource</td>
<td>&#x8BBE;&#x7F6E;&#x64AD;&#x653E;&#x6E90;</td>
</tr>
<tr>
<td>setOnPlayStateListener</td>
<td>&#x8BBE;&#x7F6E;&#x64AD;&#x653E;&#x5668;&#x72B6;&#x6001;&#x76D1;&#x542C;</td>
</tr>
<tr>
<td>setDisplay</td>
<td>&#x8BBE;&#x7F6E;&#x663E;&#x793A;&#x7A97;&#x53E3;</td>
</tr>
<tr>
<td>prepareAsync</td>
<td>&#x64AD;&#x653E;&#x5668;&#x5F00;&#x59CB;&#x51C6;&#x5907;</td>
</tr>
<tr>
<td>setVolume</td>
<td>&#x8BBE;&#x7F6E;&#x64AD;&#x653E;&#x5668;&#x97F3;&#x91CF;</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>&#x65B9;&#x6CD5;&#x540D;&#x5B57;</th>
<th>&#x7B80;&#x8981;&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>setPlayContext</td>
<td>&#x8BBE;&#x7F6E;&#x64AD;&#x653E;&#x5668;&#x8FD0;&#x884C;&#x65F6;&#x4E0A;&#x4E0B;&#x6587;</td>
</tr>
</tbody>
</table>
<h2 id="&#x505C;&#x6B62;&#x548C;&#x91CA;&#x653E;">&#x505C;&#x6B62;&#x548C;&#x91CA;&#x653E;</h2>
<table>
<thead>
<tr>
<th>&#x65B9;&#x6CD5;&#x540D;&#x5B57;</th>
<th>&#x7B80;&#x8981;&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>reset</td>
<td>&#x64AD;&#x653E;&#x5668;&#x72B6;&#x6001;&#x91CD;&#x7F6E;</td>
</tr>
<tr>
<td>stop</td>
<td>&#x505C;&#x6B62;&#x64AD;&#x653E;</td>
</tr>
<tr>
<td>release</td>
<td>&#x91CA;&#x653E;&#x64AD;&#x653E;&#x5668;&#x5BF9;&#x8C61;</td>
</tr>
</tbody>
</table>
<h2 id="&#x64AD;&#x653E;&#x4E2D;&#x64CD;&#x4F5C;">&#x64AD;&#x653E;&#x4E2D;&#x64CD;&#x4F5C;</h2>
<table>
<thead>
<tr>
<th>&#x65B9;&#x6CD5;&#x540D;&#x5B57;</th>
<th>&#x7B80;&#x8981;&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>seekTo</td>
<td>&#x5FEB;&#x8FDB;&#x6216;&#x8005;&#x5FEB;&#x9000;,&#x53C2;&#x6570;&#x5355;&#x4F4D;&#xFF1A;<code>&#x6BEB;&#x79D2;</code></td>
</tr>
<tr>
<td>pause</td>
<td>&#x6682;&#x505C;</td>
</tr>
<tr>
<td>isPlaying</td>
<td>&#x662F;&#x5426;&#x6B63;&#x5728;&#x64AD;&#x653E;</td>
</tr>
<tr>
<td>start</td>
<td>&#x5F00;&#x59CB;&#x64AD;&#x653E;</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>&#x65B9;&#x6CD5;&#x540D;&#x5B57;</th>
<th>&#x7B80;&#x8981;&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>playedByDefination</td>
<td>&#x5207;&#x6362;&#x7801;&#x7387;,&#x53C2;&#x6570;&#x8BBE;&#x7F6E;&#x5BF9;&#x5E94;<code>((PlayContext)getPlayContext()).getDefinationsMap()</code>&#x4E2D;&#x7684;<code>key</code>&#x503C;</td>
</tr>
<tr>
<td>resetPlay</td>
<td>&#x91CD;&#x65B0;&#x64AD;&#x653E;</td>
</tr>
<tr>
<td>isComplete</td>
<td>&#x662F;&#x5426;&#x64AD;&#x653E;&#x5B8C;&#x6BD5;</td>
</tr>
<tr>
<td>getPlayContext</td>
<td>&#x83B7;&#x53D6;&#x5F53;&#x524D;&#x64AD;&#x653E;&#x5668;&#x4E0A;&#x4E0B;&#x6587;</td>
</tr>
</tbody>
</table>
<h2 id="&#x64AD;&#x653E;&#x4E2D;&#x83B7;&#x53D6;&#x53C2;&#x6570;">&#x64AD;&#x653E;&#x4E2D;&#x83B7;&#x53D6;&#x53C2;&#x6570;</h2>
<table>
<thead>
<tr>
<th>&#x65B9;&#x6CD5;&#x540D;&#x5B57;</th>
<th>&#x7B80;&#x8981;&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>getVideoWidth</td>
<td>&#x83B7;&#x53D6;&#x89C6;&#x9891;&#x5BBD;</td>
</tr>
<tr>
<td>getVideoHeight</td>
<td>&#x83B7;&#x53D6;&#x89C6;&#x9891;&#x9AD8;</td>
</tr>
<tr>
<td>getCurrentPosition</td>
<td>&#x83B7;&#x53D6;&#x5F53;&#x524D;&#x64AD;&#x653E;&#x65F6;&#x95F4;,&#x5355;&#x4F4D;&#xFF1A;&#x6BEB;&#x79D2;</td>
</tr>
<tr>
<td>getBufferPercentage</td>
<td>&#x83B7;&#x53D6;&#x5F53;&#x524D;&#x7F13;&#x51B2;&#x8FDB;&#x5EA6;</td>
</tr>
<tr>
<td>getDuration</td>
<td>&#x83B7;&#x53D6;&#x89C6;&#x9891;&#x64AD;&#x653E;&#x65F6;&#x957F;</td>
</tr>
<tr>
<td>getPlayerId</td>
<td>&#x83B7;&#x53D6;&#x64AD;&#x653E;&#x5668;id,id&#x53EF;&#x4EE5;&#x4F5C;&#x4E3A;&#x8BE5;&#x64AD;&#x653E;&#x5668;&#x7684;&#x552F;&#x4E00;&#x6807;&#x8BC6;</td>
</tr>
<tr>
<td>getAttribute</td>
<td>&#x83B7;&#x53D6;&#x64AD;&#x653E;&#x5668;&#x4E00;&#x4E9B;&#x9644;&#x52A0;&#x5C5E;&#x6027;</td>
</tr>
<tr>
<td>getObserver</td>
<td>&#x83B7;&#x53D6;&#x64AD;&#x653E;&#x5668;&#x7684;&#x4E00;&#x4E2A;&#x89C2;&#x5BDF;&#x8005;</td>
</tr>
<tr>
<td>getStatus</td>
<td>&#x83B7;&#x53D6;&#x64AD;&#x653E;&#x5668;&#x72B6;&#x6001;</td>
</tr>
</tbody>
</table>
<h2 id="&#x56DE;&#x8C03;&#x4E8B;&#x4EF6;">&#x56DE;&#x8C03;&#x4E8B;&#x4EF6;</h2>
<p>&#x5728;&#x8BBE;&#x7F6E;&#x4E86;<code>setOnPlayStateListener(OnPlayStateListener playStateListener)</code>&#x4E4B;&#x540E;&#xFF0C;&#x64AD;&#x653E;&#x5668;&#x8FD4;&#x56DE;&#x7684;&#x4E8B;&#x4EF6;</p>
<blockquote>
<pre><code class="lang-java">    <span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">interface</span> <span class="hljs-title">OnPlayStateListener</span> </span>{
    <span class="hljs-comment">/**
     * <span class="hljs-doctag">@param</span> state &#x8868;&#x793A;&#x64AD;&#x653E;&#x5668;&#x8FD4;&#x56DE;&#x7684;&#x4E8B;&#x4EF6;
     * <span class="hljs-doctag">@param</span> bundle &#x5BF9;&#x4E8E;&#x67D0;&#x4E9B;&#x7279;&#x5B9A;&#x7684;&#x4E8B;&#x4EF6;&#x8FD4;&#x56DE;&#x65F6;&#xFF0C;&#x4F1A;&#x643A;&#x5E26;&#x76F8;&#x5173;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x8FD9;&#x65F6;&#x53EF;&#x4EE5;&#x4ECE;bundle&#x4E2D;&#x83B7;&#x53D6;&#x5230;
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">videoState</span><span class="hljs-params">(<span class="hljs-keyword">int</span> state,Bundle bundle)</span></span>;
    }
</code></pre>
</blockquote>
<h4 id="&#x64AD;&#x653E;&#x5668;&#x72B6;&#x6001;&#x4E8B;&#x4EF6;">&#x64AD;&#x653E;&#x5668;&#x72B6;&#x6001;&#x4E8B;&#x4EF6;</h4>
<table>
<thead>
<tr>
<th>&#x4E8B;&#x4EF6;&#x540D;&#x5B57;</th>
<th>&#x7B80;&#x5355;&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>MEDIA_EVENT_VIDEO_SIZE</td>
<td>&#x64AD;&#x653E;&#x5668;&#x83B7;&#x53D6;&#x5230;&#x89C6;&#x9891;&#x5BBD;&#x9AD8;</td>
</tr>
<tr>
<td>MEDIA_EVENT_PLAY_COMPLETE</td>
<td>&#x64AD;&#x653E;&#x89C6;&#x9891;&#x5B8C;&#x6BD5;</td>
</tr>
<tr>
<td>MEDIA_EVENT_FIRST_RENDER</td>
<td>&#x7B2C;&#x4E00;&#x5E27;&#x89C6;&#x9891;&#x6E32;&#x67D3;&#x5B8C;&#x6210;</td>
</tr>
<tr>
<td>MEDIA_EVENT_SEEK_COMPLETE</td>
<td>seek&#x5B8C;&#x6210;</td>
</tr>
<tr>
<td>MEDIA_EVENT_PREPARE_COMPLETE</td>
<td>&#x64AD;&#x653E;&#x5668;&#x51C6;&#x5907;&#x5B8C;&#x6210;</td>
</tr>
<tr>
<td>MEDIA_EVENT_BUFFER_START</td>
<td>&#x64AD;&#x653E;&#x5668;&#x5F00;&#x59CB;&#x7F13;&#x51B2;</td>
</tr>
<tr>
<td>MEDIA_EVENT_BUFFER_END</td>
<td>&#x64AD;&#x653E;&#x5668;&#x7F13;&#x51B2;&#x7ED3;&#x675F;</td>
</tr>
<tr>
<td>MEDIA_ERROR_NO_STREAM</td>
<td>&#x64AD;&#x653E;&#x9519;&#x8BEF;&#xFF0C;&#x8FDE;&#x63A5;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#x9519;&#x8BEF;&#x6216;&#x8005;&#x8D85;&#x65F6;</td>
</tr>
<tr>
<td>MEDIA_ERROR_DECODE_ERROR</td>
<td>&#x89E3;&#x7801;&#x9519;&#x8BEF;</td>
</tr>
</tbody>
</table>
<blockquote>
<p><strong>MEDIA_EVENT_VIDEO_SIZE</strong></p>
<p>&#x5F53;&#x6536;&#x5230;&#x8BE5;&#x4E8B;&#x4EF6;&#x4E4B;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5230;&#x89C6;&#x9891;&#x7684;&#x5BBD;&#x548C;&#x9AD8;&#x6570;&#x636E;</p>
<pre><code class="lang-java"><span class="hljs-keyword">case</span> ISplayer.MEDIA_EVENT_VIDEO_SIZE:
            <span class="hljs-keyword">if</span> (videoView != <span class="hljs-keyword">null</span> &amp;&amp; player != <span class="hljs-keyword">null</span>) {
                <span class="hljs-comment">/**
                 * &#x83B7;&#x53D6;&#x5230;&#x89C6;&#x9891;&#x7684;&#x5BBD;&#x9AD8;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x6B64;&#x65F6;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x89C6;&#x9891;&#x7684;&#x5BBD;&#x9AD8;&#x8BA1;&#x7B97;&#x51FA;&#x6BD4;&#x4F8B;&#xFF0C;&#x8FDB;&#x800C;&#x8BBE;&#x7F6E;&#x89C6;&#x9891;view&#x7684;&#x663E;&#x793A;&#x5927;&#x5C0F;&#x3002;
                 * &#x5982;&#x679C;&#x4E0D;&#x6309;&#x7167;&#x89C6;&#x9891;&#x7684;&#x6BD4;&#x4F8B;&#x8FDB;&#x884C;&#x663E;&#x793A;&#x7684;&#x8BDD;&#xFF0C;(&#x4EE5;surfaceView&#x4E3A;&#x4F8B;&#x5B50;)&#x5185;&#x5BB9;&#x4F1A;&#x586B;&#x5145;&#x6574;&#x4E2A;surfaceView&#x3002;
                 * &#x610F;&#x5473;&#x7740;&#x4F60;&#x7684;surfaceView&#x663E;&#x793A;&#x7684;&#x5185;&#x5BB9;&#x6709;&#x53EF;&#x80FD;&#x662F;&#x62C9;&#x4F38;&#x7684;
                 */</span>
                videoView.onVideoSizeChange(player.getVideoWidth(), player.getVideoHeight());
                <span class="hljs-comment">/**
                 * &#x83B7;&#x53D6;&#x5BBD;&#x9AD8;&#x7684;&#x53E6;&#x5916;&#x4E00;&#x79CD;&#x65B9;&#x5F0F;
                 */</span>
                bundle.getInt(<span class="hljs-string">&quot;width&quot;</span>);
                bundle.getInt(<span class="hljs-string">&quot;height&quot;</span>);
            }
<span class="hljs-keyword">break</span>;
</code></pre>
</blockquote>
<table>
<thead>
<tr>
<th>&#x4E8B;&#x4EF6;&#x540D;&#x5B57;</th>
<th>&#x7B80;&#x5355;&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>PLAYER_PROXY_ERROR</td>
<td>&#x64AD;&#x653E;&#x4EE3;&#x7406;&#x9519;&#x8BEF;</td>
</tr>
</tbody>
</table>
<blockquote>
<p><strong>PLAYER_PROXY_ERROR</strong></p>
<p>&#x8BE5;&#x4E8B;&#x4EF6;&#x6536;&#x5230;&#x4E4B;&#x540E;&#xFF0C;&#x8868;&#x660E;&#x64AD;&#x653E;&#x5668;&#x4E1A;&#x52A1;&#x5C42;&#x51FA;&#x9519;&#x4E86;&#xFF0C;&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5230;&#x5177;&#x4F53;&#x7684;&#x9519;&#x8BEF;&#x4FE1;&#x606F;</p>
<pre><code class="lang-java"><span class="hljs-keyword">case</span> ISplayer.PLAYER_PROXY_ERROR:
    <span class="hljs-keyword">int</span> errorCode = bundle.getInt(<span class="hljs-string">&quot;errorCode&quot;</span>);
    String msg = bundle.getString(<span class="hljs-string">&quot;errorMsg&quot;</span>);
<span class="hljs-keyword">break</span>;
</code></pre>
</blockquote>
<h4 id="&#x89C6;&#x9891;&#x4FE1;&#x606F;&#x76F8;&#x5173;&#x4E8B;&#x4EF6;">&#x89C6;&#x9891;&#x4FE1;&#x606F;&#x76F8;&#x5173;&#x4E8B;&#x4EF6;</h4>
<table>
<thead>
<tr>
<th>&#x4E8B;&#x4EF6;&#x540D;&#x5B57;</th>
<th>&#x7B80;&#x5355;&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>EventPlayProxy.PROXY_VIDEO_INFO_REFRESH</td>
<td>&#x83B7;&#x53D6;&#x5230;&#x89C6;&#x9891;&#x7684;&#x57FA;&#x672C;&#x4FE1;&#x606F;&#xFF0C;&#x6BD4;&#x5982;&#x6807;&#x9898;&#xFF0C;&#x662F;&#x5426;&#x652F;&#x6301;&#x4E0B;&#x8F7D;&#x7B49;</td>
</tr>
<tr>
<td>EventPlayProxy.PROXY_WAITING_SELECT_DEFNITION_PLAY</td>
<td>&#x83B7;&#x53D6;&#x5230;&#x89C6;&#x9891;&#x6240;&#x652F;&#x6301;&#x7684;&#x7801;&#x7387;</td>
</tr>
<tr>
<td>EventPlayProxy.PROXY_WATING_SELECT_ACTION_LIVE_PLAY</td>
<td>&#x83B7;&#x53D6;&#x5230;&#x6D3B;&#x52A8;&#x76F4;&#x64AD;&#x4FE1;&#x606F;</td>
</tr>
</tbody>
</table>
<blockquote>
<p><strong>EventPlayProxy.PROXY_VIDEO_INFO_REFRESH</strong></p>
<p>&#x8BE5;&#x4E8B;&#x4EF6;&#x6536;&#x5230;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5230;&#x89C6;&#x9891;&#x7684;&#x57FA;&#x672C;&#x4FE1;&#x606F;</p>
<pre><code class="lang-java"><span class="hljs-keyword">case</span> EventPlayProxy.PROXY_VIDEO_INFO_REFRESH:
            <span class="hljs-keyword">if</span> (player == <span class="hljs-keyword">null</span> || player.getPlayContext() == <span class="hljs-keyword">null</span>) {
                <span class="hljs-keyword">return</span>;
            }
            ((PlayContext) player.getPlayContext()).getVideoTitle();
            ((PlayContext) player.getPlayContext()).isCanbeDownload();
            <span class="hljs-keyword">break</span>;
        }
</code></pre>
</blockquote>
<hr>
<blockquote>
<p><strong>EventPlayProxy.PROXY_WAITING_SELECT_DEFNITION_PLAY</strong></p>
<p>&#x6536;&#x5230;&#x8BE5;&#x4E8B;&#x4EF6;&#x4E4B;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5230;&#x89C6;&#x9891;&#x5BF9;&#x4E8E;&#x7684;&#x7801;&#x7387;</p>
<pre><code class="lang-java"><span class="hljs-keyword">case</span> EventPlayProxy.PROXY_WAITING_SELECT_DEFNITION_PLAY:
            PlayContext playContext = (PlayContext) player.getPlayContext();
            <span class="hljs-keyword">if</span> (playContext != <span class="hljs-keyword">null</span>) {
                playContext.getDefinationsMap();
            }
            <span class="hljs-keyword">break</span>;
</code></pre>
</blockquote>
<hr>
<blockquote>
<p><strong>EventPlayProxy.PROXY_WATING_SELECT_ACTION_LIVE_PLAY</strong></p>
<p>&#x6536;&#x5230;&#x8BE5;&#x4E8B;&#x4EF6;&#x4E4B;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5230;&#x6D3B;&#x52A8;&#x76F4;&#x64AD;&#x5BF9;&#x4E8E;&#x7684;&#x6D3B;&#x52A8;&#x4FE1;&#x606F;</p>
<pre><code class="lang-java"><span class="hljs-keyword">case</span> EventPlayProxy.PROXY_WATING_SELECT_ACTION_LIVE_PLAY:
            PlayContext playContextAction = (PlayContext) player.getPlayContext();
            ActionInfo actionInfo = playContextAction.getActionInfo();<span class="hljs-comment">//&#x83B7;&#x53D6;&#x5230;&#x6D3B;&#x52A8;&#x76F4;&#x64AD;&#x4FE1;&#x606F;</span>
            <span class="hljs-keyword">if</span> (actionInfo != <span class="hljs-keyword">null</span>) {
                <span class="hljs-comment">/**
                 * &#x5982;&#x679C;&#x5F53;&#x524D;&#x6D3B;&#x52A8;&#x76F4;&#x64AD;&#x662F;&#x591A;&#x4E2A;&#x76F4;&#x64AD;&#x7A97;&#x53E3;&#xFF0C; &#x9009;&#x62E9;&#x4E00;&#x8DEF;&#x53EF;&#x7528;&#x7684;&#x6D3B;&#x52A8;&#x76F4;&#x64AD;
                 */</span>
                LiveInfo liveInfo = actionInfo.getFirstOnUseOrSeekLive();
                <span class="hljs-keyword">if</span> (liveInfo != <span class="hljs-keyword">null</span>) {
                    mPlayContext.setLiveId(liveInfo.getLiveId());
                }
            }
        <span class="hljs-keyword">break</span>;
</code></pre>
</blockquote>
<h4 id="&#x5E7F;&#x544A;&#x4E8B;&#x4EF6;">&#x5E7F;&#x544A;&#x4E8B;&#x4EF6;</h4>
<table>
<thead>
<tr>
<th>&#x4E8B;&#x4EF6;&#x540D;&#x5B57;</th>
<th>&#x7B80;&#x5355;&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>EventPlayProxy.PLAYER_PROXY_AD_START</td>
<td>&#x5E7F;&#x544A;&#x5F00;&#x59CB;&#x64AD;&#x653E;</td>
</tr>
<tr>
<td>EventPlayProxy.PLAYER_PROXY_AD_END</td>
<td>&#x5E7F;&#x544A;&#x64AD;&#x653E;&#x7ED3;&#x675F;</td>
</tr>
<tr>
<td>EventPlayProxy.PLAYER_PROXY_AD_POSITION</td>
<td>&#x5E7F;&#x544A;&#x5012;&#x8BA1;&#x65F6;,&#x6BCF;&#x79D2;&#x4E00;&#x6B21;&#x8FD4;&#x56DE;&#xFF08;&#x5E7F;&#x544A;&#x64AD;&#x653E;&#x65F6;&#xFF09;</td>
</tr>
</tbody>
</table>
<h4 id="&#x65F6;&#x79FB;&#x4E8B;&#x4EF6;">&#x65F6;&#x79FB;&#x4E8B;&#x4EF6;</h4>
<table>
<thead>
<tr>
<th>&#x4E8B;&#x4EF6;&#x540D;&#x5B57;</th>
<th>&#x7B80;&#x5355;&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>EventPlayProxy.PLAYER_TIME_SHIRT</td>
<td>&#x65F6;&#x79FB;&#x529F;&#x80FD;&#x652F;&#x6301;&#x4E8B;&#x4EF6;(<strong>&#x8BE5;&#x529F;&#x80FD;&#x76EE;&#x524D;&#x4EC5;&#x652F;&#x6301;&#x6D3B;&#x52A8;&#x76F4;&#x64AD;</strong>)</td>
</tr>
<tr>
<td>EventPlayProxy.PLAYER_TIME_SHIRT_SEEK_COMPLETE</td>
<td>&#x65F6;&#x79FB;&#x64CD;&#x4F5C;&#x5B8C;&#x6210;</td>
</tr>
<tr>
<td>EventPlayProxy.PLAYER_TIME_SHIRT_SEEK_ERROR</td>
<td>&#x65F6;&#x79FB;&#x64CD;&#x4F5C;&#x5931;&#x8D25;</td>
</tr>
</tbody>
</table>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../part1/player_structure.html" class="navigation navigation-prev " aria-label="Previous page: 播放器基本架构"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../part1/playcontext_introduction.html" class="navigation navigation-next " aria-label="Next page: PlayContext ApI说明"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
